Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix segfault, handle symbol conversion correctly #319

Merged
merged 1 commit into from
Sep 21, 2024

Conversation

bnoordhuis
Copy link
Collaborator

Symbol::Description() normally returns a string, but when the symbol does not have a description, it returns undefined.

The String::Utf8Value constructor requires that a v8::Context is active for the ToString operation it executes. ToString is a no-op for strings (hence no crash) but not for undefined.

Add a Context::Scope to fix that.

Fixes: #318

Symbol::Description() normally returns a string, but when the symbol
does not have a description, it returns undefined.

The String::Utf8Value constructor requires that a v8::Context is active
for the ToString operation it executes. ToString is a no-op for strings
(hence no crash) but not for undefined.

Add a Context::Scope to fix that.

Fixes: rubyjs#318
@bnoordhuis bnoordhuis merged commit 8c13559 into rubyjs:main Sep 21, 2024
22 of 25 checks passed
@bnoordhuis bnoordhuis deleted the symbol-segfault branch September 21, 2024 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Symbol() segfaults
1 participant